
d={"dog":"狗","pig":"猪","sheep":"绵羊","goat":"山羊"}
print(d)
print(type(d))
print(d["dog"])
#print(d["cat"])#不是 None，会报错
d["dog"]="小狗"
print(d["dog"])
d["cat"]="波斯猫"
print(d)
del d["pig"]
print("删除后：",d)
#d.clear()
#del d
d.setdefault("desk","不晓得")
print(d)
d["desk"]="桌子"
print("Desk 是：",d["desk"])
del d["desk"]
#依然有错 ：print("现在，Desk 是：",d["desk"])
k=input("请输入key：")
#if d.__contains__(k):
if k in d:#判断的就是 key
    print("对应的value是"+d[k])
else:
    print("没有对应的key")
